function neurogeometryCover

figure('Position', [118   689   560   420]);

load('C:\_Projects\septal circuit\dendriteImage.mat')
map = dendriteImage;
cols = size(map, 2);
map = [map(:, round(cols/2)+1:end) map(:, 1:round(cols/2))];
map = flipud(map);

a = 1;
b = 400;
c = round(.25*b);
d = b-c;

[x,y,z] = sphere(b);
z = z*2;

staveWidth = round(b*.04);
staveThickness = 1.02;

g = c;
h = g+staveWidth;
x(g:h,:) = x(g:h,:)*staveThickness;
y(g:h,:) = y(g:h,:)*staveThickness;

g = round(c + (d-c)/3)-round(staveWidth/2);
h = g+staveWidth;
x(g:h,:) = x(g:h,:)*staveThickness;
y(g:h,:) = y(g:h,:)*staveThickness;

g = round(c + (d-c)*2/3)-round(staveWidth/2);
h = g+staveWidth;
x(g:h,:) = x(g:h,:)*staveThickness;
y(g:h,:) = y(g:h,:)*staveThickness;

g = d-staveWidth;
h = d;
x(g:h,:) = x(g:h,:)*staveThickness;
y(g:h,:) = y(g:h,:)*staveThickness;

warp(x(c:d,:),y(c:d,:),z(c:d,:),map)

axis equal
set(gca, 'CLimMode', 'auto');
% shading flat
colormap jet3

set(gca, 'Visible', 'off');

light1 = light('Position',[0.5 -0.5336 -0.0801], 'Color', 'w');

hold on;

% % fill3([5 -5 -5 5], [-5 -5 5 5], [-1 -1 -1 -1], 'w')
% x = [-5 5; -5 5];
% y = [-5 5; -5 5]; 
% z = [0 0; 0 0]; 
% warp(x, y, map)
